<template>
 <view class="main">
   <view class="logo">
	 <view class="ilist" @click="myitem">
	    <image src="https://ppp.new.zeroitem.cn/ppp/menu.png" style="width:64rpx;height:64rpx"></image>
	 </view>
	 <image src="https://ppp.new.zeroitem.cn/ppp/logo.png" class="imglog"></image>   
   </view>
   <view class="menu">
 	 <view class="menu-1" @click="dqzz">当前状态</view>
	 <view class="menu-1" @click="jdjl">接单记录</view>
 	 <view class="menu-1 cur">订单大厅</view>
 	 <view class="menu-1" @click="mymain">我的主页</view> 
   </view>
   
   <view class="part1" @click="shuxin">
	 <view class="part2">
	  <view class="part3">
		  <view class="part4">
			  <image src="https://ppp.new.zeroitem.cn/ppp/sx.png" class="sximg"></image>
		  </view>
	  </view> 
	 </view>  
   </view>
   <view class="order" v-for="(item,i) of xslist">
	 <view class="order1">
		<view class="fm1">【悬赏单】</view>
		<view class="fm2">{{item.total_price}}￥</view>
		<view class="fm3">新</view>
		<view class="fm4">60″</view>
	 </view>  
	 <view class="order2">
	   <view class="order2-1">
		  <view class="pm1"></view> 
		  <view class="pm2">时间</view>
		  <view class="pm3">{{item.pdate}}  {{item.ptime}}</view>
	   </view>
	   <view class="order2-1">
			  <view class="pm1 bg2"></view> 
			  <view class="pm2">地点</view>
			  <view class="pm3">{{item.jtdz}}</view>
	    </view>		
	   <view class="order2-1">
			  <view class="pm1 bg3"></view> 
			  <view class="pm2">要求</view>
			  <view class="pm3">{{item.str}}</view>
	    </view>					
	 </view>
	 <view class="order3">
		<view class="order3-1">订单号：{{item.ordersn}}</view> 
		<view class="order3-2" @click="qiangdan(item.id)">立即抢单</view>
	 </view>   
   </view> 

  </view>
</template>

<script>
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	import {
		toLogin
	} from '@/utils/login'
	
	import {
		loadingFun,
		menuJump,
		jumpurl
	} from '@/utils/tools'	
	import {
	  xslist
	} from '@/api/ppp'		
    import {
		loadingType
	} from '@/utils/type'
	
	const app = getApp()
	export default {
		data() {
			return {
             xslist:[],
			 page: 1,
			 status: loadingType.LOADING
			}
		},
		onLoad() {
		  this.getorderlist();
		},
		onShow() {
         
		},

		onReachBottom() {
	     this.getorderlist()
	     setTimeout(() => {
	     	uni.stopPullDownRefresh();
	     }, 1000);	
		},
		onPullDownRefresh() {

		},

		methods: {
		shuxin(){
		  var that=this;
		  that.page=1;
		  that.xslist=[];
		  that.status=loadingType.LOADING;
		  that.getorderlist();	
		},
		async getorderlist(){
		  const data = await loadingFun(xslist,this.page,this.xslist,this.status,{});	
		  if (!data) return
		  this.page = data.page
		  this.xslist = data.dataList
		  this.status = data.status	
		},
		qiangdan(oid){
		  uni.redirectTo({
		  	url:"/pages/ppp/index/orderConfire?qd=1&oid="+oid
		  })		
		},
		myitem(){
		 uni.redirectTo({
		 	url:"/pages/ppp/ps/menu"
		 })	
		},
		jdjl(){
            jumpurl('pages/ppp/ps/jjjl');
		},
		dddt(){
		   jumpurl('pages/ppp/ps1/dddt');	 
		},
		 mymain(){
		    jumpurl('pages/ppp/ps/main1');	 
		 },
			
		dqzz(){
		   jumpurl('pages/ppp/ps1/dqzz');	 
		}
		},
		computed: {
			...mapGetters(['isLogin']),
		}
	}
</script>

<style>
 @import "./dddt.css";	
</style>
